package com.mengniu.common.social.mengniu98k;

import com.mengniu.common.social.mengniu98k.source.AuthMengniuSource;
import me.zhyd.oauth.request.AuthDefaultRequest;

/**
 * @author: dgyu-398305246@qq.com
 * @createTime: 2023年12月04 11:30:09
 * @description: Oauth2 默认接口说明
 */
public enum AuthMengniu98kSource implements AuthMengniuSource {

    /**
     * 蒙牛98k的api定义
     */
    MENGNIU98K {
        @Override
        public String userLoginout() {
            return AuthMengniu98kRequest.SERVER_URL + "/auth/authz/logout";
        }

        @Override
        public String userInfoExt() {
            return AuthMengniu98kRequest.SERVER_URL + "/auth/authz/info";
        }

        @Override
        public String userRoles() {
            return AuthMengniu98kRequest.SERVER_URL + "/authy/authz/roles";
        }

        @Override
        public String userRoutes() {
            return AuthMengniu98kRequest.SERVER_URL + "/authy/authz/routes";
        }

        @Override
        public String userPerms() {
            return AuthMengniu98kRequest.SERVER_URL + "/authy/authz/perms";
        }

        /**
         * 授权的api
         */
        @Override
        public String authorize() {
            return AuthMengniu98kRequest.SERVER_URL + "/auth/oauth2/v2/authorize";
        }

        /**
         * 获取accessToken的api
         */
        @Override
        public String accessToken() {
            return AuthMengniu98kRequest.SERVER_URL + "/auth/oauth2/v2/token";
        }

        /**
         * 获取用户信息的api
         */
        @Override
        public String userInfo() {
            return AuthMengniu98kRequest.SERVER_URL + "/auth/authz/info";
        }

        /**
         * 平台对应的 AuthRequest 实现类，必须继承自 {@link AuthDefaultRequest}
         */
        @Override
        public Class<? extends AuthDefaultRequest> getTargetClass() {
            return AuthMengniu98kRequest.class;
        }

    }
}
